home *** CD-ROM | disk | FTP | other *** search
/ SuperHack / SuperHack CD.bin / CODING / CPP / WFC010.ZIP / SRC / OVRLPD.CPP < prev    next >
C/C++ Source or Header  |  1995-12-07  |  2KB  |  69 lines

  1. #include <wfc.h>
  2. #pragma hdrstop
  3.  
  4. /*
  5. ** Author: Samuel R. Blackburn
  6. ** CI$: 76300,326
  7. ** Internet: sammy@sed.csc.com
  8. **
  9. ** You can use it any way you like as long as you don't try to sell it.
  10. **
  11. ** Any attempt to sell WFC in source code form must have the permission
  12. ** of the original author. You can produce commercial executables with
  13. ** WFC but you can't sell WFC.
  14. **
  15. ** Copyright, 1995, Samuel R. Blackburn
  16. **
  17. ** $Workfile: $
  18. ** $Revision: $
  19. ** $Modtime: $
  20. */
  21.  
  22. #if defined( _DEBUG )
  23. #undef THIS_FILE
  24. static char BASED_CODE THIS_FILE[] = __FILE__;
  25. #define new DEBUG_NEW
  26. #endif
  27.  
  28. COverlapped::COverlapped()
  29. {
  30.    m_Overlapped.Internal     = 0;
  31.    m_Overlapped.InternalHigh = 0;
  32.    m_Overlapped.Offset       = 0;
  33.    m_Overlapped.OffsetHigh   = 0;;
  34.    m_Overlapped.hEvent       = ::CreateEvent( NULL, TRUE, FALSE, NULL );
  35. }
  36.  
  37. COverlapped::COverlapped( const OVERLAPPED * source )
  38. {
  39.    m_Overlapped.Internal     = source->Internal;
  40.    m_Overlapped.InternalHigh = source->InternalHigh;
  41.    m_Overlapped.Offset       = source->Offset;
  42.    m_Overlapped.OffsetHigh   = source->OffsetHigh;
  43.    m_Overlapped.hEvent       = source->hEvent;
  44. }
  45.  
  46. COverlapped::~COverlapped()
  47. {
  48.    if ( m_Overlapped.hEvent != NULL )
  49.    {
  50.       ::CloseHandle( m_Overlapped.hEvent );
  51.    }
  52.  
  53.    m_Overlapped.Internal     = 0;
  54.    m_Overlapped.InternalHigh = 0;
  55.    m_Overlapped.Offset       = 0;
  56.    m_Overlapped.OffsetHigh   = 0;;
  57.    m_Overlapped.hEvent       = NULL;
  58. }
  59.  
  60. void COverlapped::SetEvent( HANDLE new_event_handle )
  61. {
  62.    if ( m_Overlapped.hEvent != NULL )
  63.    {
  64.       ::CloseHandle( m_Overlapped.hEvent );
  65.    }
  66.  
  67.    m_Overlapped.hEvent = new_event_handle;
  68. }
  69.